package stz.flash.main.state;

import stz.flash.main.FlashTimer;
import stz.flash.main.ModeChangeHandler;
import stz.flash.main.flashlight.field.BacklightField;
import stz.flash.main.flashlight.field.LedField;
import stz.flash.option.TimerDurationController;


public class FlashModeState implements ModeState {

	private static FlashModeState instance = new FlashModeState();
	
	private FlashModeState() {
	}

	public static FlashModeState getIns() {
		return instance;
	}

	public synchronized void runC() {
		ModeChangeHandler.changeIntoStrobeMode();
	}
	
	public void runL() {
		LedField.toggleLED();
	}

	public void runB() {
		BacklightField.toggleBacklight();
	}
	
	public synchronized void runSpace() {
		FlashTimer.getIns().stopAndStart(FlashTimer.STOP_AND_START_flashlight_toggle);
	}
	
	public void runVolumeUp() {
		TimerDurationController.increaseTimerDuration();
	}
	
	public void runVolumeDown() {
		TimerDurationController.decreaseTimerDuration();
	}
	
	public void runSpeakerphone() {
		FlashTimer.getIns().stopAndStart(FlashTimer.STOP_AND_START_timer_reset);
	}
}